using System.Collections;
using System.Collections.Generic;
using UnityEngine;

/// <summary>
///  捏脸系统代码示例：控制 BlendShape
/// </summary>
public class FaceCustomizer : MonoBehaviour
{
    public SkinnedMeshRenderer faceMesh;
    
    public void SetBlendShape(string shapeName, float value)
    {
        int count = faceMesh.sharedMesh.blendShapeCount;
        int index = faceMesh.sharedMesh.GetBlendShapeIndex(shapeName);
        if (index >= 0)
        {
            faceMesh.SetBlendShapeWeight(index, value);
        }
        
    }
    // 鼻子大小滑杆
    public void OnNoseSliderChange(float value)
    {
        SetBlendShape("Nose_Size", value);
    }
}
